{% extends "base.html" %}
{% block title %}A3B - Resultados{% endblock %}

{% block content %}
{% if error %}
    <center>{{error}}</center>
{% else %}
{% if resultado %}
    <div id="resultados" class="resultados">
	<h2>Resultados de la busqueda</h2>
	{% for libro in resultado %}
		<div class="libro-resultado">
				<div class="descripcion">
					<a href="{{ libro.link }}" class="titulo"><span>{{ libro.titulo }}</span></a>
					<div class="autor">Autor: {% if otro %}
					<a href="/shop/autor/{{libro.autor}}/">{{libro.autor}}</a>
					{% else %}
					{% for autor in libro.autor.all %}
                                        <a href="/shop/autor/{{autor.username}}/">{{ autor.first_name }} {{autor.last_name}}</a>
                                        {% endfor %}
					{% endif %}</div>
					<div class="autor">Ejemplares disponibles: {{ libro.cantidad }}</div>
					<div class="autor">Topico: {{ libro.topico }}</div>
					<div class="autor">Feacha publicacion: {{ libro.fecha_publicacion }}</div>
					<div class="precio">${{ libro.costo }}</div>
					{% if user.is_authenticated %}
						<a href="{%if otro%}/shop/cart/add/{{libro.isbn}}/{%else%}{{libro.orderUrl}}{%endif%}">Agregar al carrito</a>
					{% else %}
						Sign up to shop
					{% endif %}
				</div>
			</div>
	{% endfor %}
	</div>
{% else %}
    <br />
    <center>No hay resultados en la busqueda</center>
{% endif %}
{% endif %}
{% endblock %}

<!-- Paginacion!
{ % extends "shop.html" % }
{ %block content% }
<div id="resultados" class="resultados">
	<div class="libro-resultado">
		<div class="foto">
			<a href="#"><img src="img/libro-1.gif" alt="libro-1" class="libro" /></a>
		</div>
		<div class="descripcion">
			<a href="#" class="titulo"><span>Database Systems</span></a>
			<div class="autor">Autor: Peter Rob</div>
			<div class="autor">(Paperback - Jan 15, 2007)</div>
			<div class="autor">Ejemplaros disponibles: 2</div>
			<div class="precio">$14.93</div>
			<input type="button" name="test" value="Comprar" />
		</div>
	</div>
	<br />
	<h2>Descripcion</h2>
	<p>Beginning Database Design: From Novice to Professional provides short, easy-to-read explanations of how to get database design right the first time. This book offers numerous examples to help you avoid the many pitfalls that entrap new and not-so-new database designers. Through the help of use cases and class diagrams modeled in the UML, youll learn how to discover and represent the details and scope of the problem in question.</p>
	<p>Database design is not an exact science, and solid database design principles and examples help demonstrate the consequences of simplifications and pragmatic decisions. The rationale is to try to keep it simple, but allow room for development as situations change or resources permit. The book also features an introduction for implementing the final design in a relational database.</p>
</div>
{ %endblock% }
	<div id="resultados" class="resultados">
		{% for libro in libros %}
			<div class="libro-resultado">
				<div class="foto">
					<a href="{{ libro.link }}"><img width="87px" width="119px" src="{{ libro.foto }}" alt="{{ libro.titulo }}" class="libro" /></a>
				</div>
				<div class="descripcion">
					<a href="{{ libro.link }}" class="titulo"><span>{{ libro.titulo }}</span></a>
					<div class="autor">Autor: {{ libro.autor }}</div>
					<div class="autor">{{ libro.fechaPublicacion }}</div>
					<div class="precio">{{ libro.precio }}</div>
					<input type = "submit" value = "Agregar"/>
				</div>
			</div>
		{% endfor %}
	</div>

-->